home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1998 January / PC Answers Issue 49 Cover CD January 1998.iso / Apps / Director / DATA.Z / Widget Wizard.dir / WidgtBehaviors_14_go next-2 picts.ls < prev    next >
Encoding:
Text File  |  1997-05-10  |  2.0 KB  |  76 lines

  1. property UpCM, DownCM, button_active, whichevent
  2.  
  3. on getPropertyDescriptionList
  4.   set description to [:]
  5.   if the currentSpriteNum = 0 then
  6.     set memdefault to 0
  7.   else
  8.     set memref to the member of sprite the currentSpriteNum
  9.     set castLibNum to the castLibNum of memref
  10.     set memdefault to member (the memberNum of member memref + 1) of castLib castLibNum
  11.   end if
  12.   addProp(description, #DownCM, [#default: memdefault, #format: #bitmap, #comment: "Pict for Down:"])
  13.   addProp(description, #whichevent, [#default: #mouseUp, #format: #symbol, #comment: "Go Next On Which Event:", #range: [#mouseUp, #mouseDown, #mouseEnter, #mouseLeave, #mouseUpOutSide]])
  14.   return description
  15. end
  16.  
  17. on getBehaviorDescription
  18.   return "Button, auto set up pict, switch pict down, go to next marker on user defined event"
  19. end
  20.  
  21. on getAssocMembers
  22.   set myPropList to [DownCM]
  23.   return myPropList
  24. end
  25.  
  26. on beginSprite me
  27.   set the UpCM of me to the member of sprite the spriteNum of me
  28.   set the button_active of me to 0
  29.   puppetSprite(the spriteNum of me, 1)
  30. end
  31.  
  32. on endSprite me
  33.   puppetSprite(the spriteNum of me, 0)
  34. end
  35.  
  36. on mouseDown me
  37.   set the member of sprite the spriteNum of me to member the DownCM of me
  38.   set the button_active of me to 1
  39.   if the whichevent of me = #mouseDown then
  40.     go(#next)
  41.   end if
  42. end
  43.  
  44. on mouseUp me
  45.   set the member of sprite the spriteNum of me to member the UpCM of me
  46.   set the button_active of me to 0
  47.   if the whichevent of me = #mouseUp then
  48.     go(#next)
  49.   end if
  50. end
  51.  
  52. on mouseUpOutSide me
  53.   set the button_active of me to 0
  54.   if the whichevent of me = #mouseUpOutSide then
  55.     go(#next)
  56.   end if
  57. end
  58.  
  59. on mouseLeave me
  60.   if the button_active of me then
  61.     set the member of sprite the spriteNum of me to member the UpCM of me
  62.   end if
  63.   if the whichevent of me = #mouseLeave then
  64.     go(#next)
  65.   end if
  66. end
  67.  
  68. on mouseEnter me
  69.   if the button_active of me then
  70.     set the member of sprite the spriteNum of me to member the DownCM of me
  71.   end if
  72.   if the whichevent of me = #mouseEnter then
  73.     go(#next)
  74.   end if
  75. end
  76.